package com.erp.framework.types;

import java.util.Date;

import com.erp.framework.SimpleConstants;
import com.erp.framework.util.CommonUtil;

public class CustomUtilDate extends Date implements SimpleConstants{
    
    /**
     * 
     */
    public CustomUtilDate() {
        super();
    }
    
    /**
     * @param date
     */
    public CustomUtilDate(long date){
        super(date);
    }
    
    /**
     * @param date
     */
    public CustomUtilDate(java.util.Date date) {
        super(date.getTime());
    }
    
    /**
     * @param date
     */
    public CustomUtilDate(java.sql.Date date) {
        super(date.getTime());
    }
    
    /**
     * @param date
     */
    public CustomUtilDate(java.sql.Timestamp date) {
        super(date.getTime());
    }

    /**
     * @deprecated
     * @param year
     * @param month
     * @param date
     */
    public CustomUtilDate(int year, int month, int date) {
        super(year, month, date);
    }

    /**
     * @deprecated
     * @param year
     * @param month
     * @param date
     * @param hour
     * @param min
     */
    public CustomUtilDate(int year, int month, int date, int hour, int min) {
        super(year, month, date, hour, min);
    }

    /**
     * @deprecated
     * @param year
     * @param month
     * @param date
     * @param hour
     * @param min
     * @param sec
     */
    public CustomUtilDate(int year, int month, int date, int hour, int min,
            int sec) {
        super(year, month, date, hour, min, sec);
    }

    /**
     * @deprecated
     * @param date
     */
    public CustomUtilDate(String date) {
        super(date);
    }
    
    public static CustomUtilDate customize(java.util.Date date){
        if(date == null){
            return null;
        } else {
            return new CustomUtilDate(date);
        }
    }
    
    public static CustomUtilDate customize(java.sql.Date date){
        if(date == null){
            return null;
        } else {
            return new CustomUtilDate(date);
        }
    }
    
    public static CustomUtilDate customize(java.sql.Timestamp date){
        if(date == null){
            return null;
        } else {
            return new CustomUtilDate(date);
        }
    }
    
    public String toString() {
        return CommonUtil.dateToString(this, OUTPUT_DATE_FORMAT);
    }
}
